// @ts-ignore
/* eslint-disable */
import request from '@/request'

/** 创建分类 POST /api/categories/add */
export async function addCategoriesUsingPost(
  body: API.CategoriesAddRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong_>('/api/categories/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 删除分类 POST /api/categories/delete */
export async function deleteCategoriesUsingPost(
  body: API.DeleteRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>('/api/categories/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 根据 id 获取分类 GET /api/categories/get/vo */
export async function getCategoriesVoByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getCategoriesVOByIdUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseCategoriesVO_>('/api/categories/get/vo', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 管理端-分页获取分类列表 POST /api/categories/list/page */
export async function listCategoriesByPageUsingPost(
  body: API.CategoriesQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageCategories_>('/api/categories/list/page', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 分页获取分类列表（封装类） POST /api/categories/list/page/vo */
export async function listCategoriesVoByPageUsingPost(
  body: API.CategoriesQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageCategoriesVO_>('/api/categories/list/page/vo', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 管理端-更新分类 POST /api/categories/update */
export async function updateCategoriesUsingPost(
  body: API.CategoriesUpdateRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>('/api/categories/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}
